package com.ymttest.database.sqlwapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.core.tool.Logger;
import com.ymt.database.SqlManager;

/************************************************************************************
 * @File name : YmtUserWapper.java
 * @Author : zhouyi
 * @Date : 2015年4月2日
 * @Copyright : 洋码头
 ************************************************************************************/
public class RouteUserWhiteListWapper {
	SqlManager manage;

	public RouteUserWhiteListWapper() {
		manage = new SqlManager("xlobosit1");
	}

	//根据口岸id查询
	public List<Map> selectbyLogisticId (int LogisticId)throws InterruptedException{
		@SuppressWarnings("unchecked")
		List <Map> RouteUserList=manage.getSelectResults(
				"com.ymttest.database.mapping.RouteUserWhiteListMapper.selectbyLogisticId", LogisticId);
    	manage.commit();
		return RouteUserList;
	}
	
	//根据口岸id & 清关供应商id查询
	public List<Map> selectbyLogisticIdAndSupplyId (int LogisticId , int SupplyId)throws InterruptedException{
		@SuppressWarnings("unchecked")
		Map<String, Object> map = new HashMap<String, Object>(); 
		map.put("LogisticId", LogisticId);
		map.put("SupplyId", SupplyId);
		
		List <Map> RouteUserList=manage.getSelectResults(
				"com.ymttest.database.mapping.RouteUserWhiteListMapper.selectbyLogisticIdAndSupplyId", map);
    	manage.commit();
		return RouteUserList;
	}


	public static void main(String args[]) {
	    try {
	    		Logger.debug(new RouteUserWhiteListWapper().selectbyLogisticIdAndSupplyId(1,3).get(0).get("XloboUserName"));
	    		
	    } catch (InterruptedException e) {
	        e.printStackTrace();
	    }
	}
}
